import axios from 'axios';
import BaseURL from './api';

export default class HomeworkService {
    static async getHomework(data) {
        const res = await axios.get(
            BaseURL+'/homework/',
            {params: data},
        )
        return res;
    }
    static async addHomework(data) {
        const res = await axios.post(
            BaseURL+'/homework/',
            data
        )
        return res;
    }
    static async submitHomework(data) {
        const res = await axios.post(
            BaseURL+'/homework/submit',
            data
        )
        return res;
    }
    static async scoreHomework(data) {
        const res = await axios.post(
            BaseURL+'/homework/score',
            data
        )
        return res;
    }
    static async getReportsByHomeworkId(data) {
        const res = await axios.post(
            BaseURL+'/homework/reports',
            data
        )
        return res;
    }
    static async getReportsByStudent(data) {
        const res = await axios.post(
            BaseURL+'/homework/report',
            data
        )
        return res;
    }
}
